package com.jp.api.tool;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class AiTools {


    /**
     * 信息检索
     * @return
     */
    @Tool(description = "获取当前时间")
    String getCurrentDateTime(){
        System.out.printf("getCurrentDateTime接口被调用");
        return LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }

    @Tool(description = "设置一个闹钟")
    void setAlarm(@ToolParam(description = "需要设定的时间") String time){
        System.out.printf("设置闹钟时间为："+time);
    }

}
